﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 会员卡管理系统
{
    public partial class AddNewHouse : Form
    {
        Vipclass.tb_viphouseinfo tbVip = new Vipclass.tb_viphouseinfo();//相关参数
        Vipclass.tbVipHouseMenthod tbVipMenthod = new Vipclass.tbVipHouseMenthod();//相关操作处理 
        public AddNewHouse()
        {
            InitializeComponent();
            button1.DialogResult = DialogResult.OK;
            button2.DialogResult = DialogResult.Cancel;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            tbVip.Strhouseid = textBox1.Text;
            if (tbVipMenthod.tbhousefoadd(tbVip) == 1)
            {
                MessageBox.Show("添加房间"+textBox1.Text+"成功！","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                MessageBox.Show("添加失败！","错误",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
    }
}
